!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(r=r||self).uuidv3=n()}(this,(function(){"use strict";for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);function t(r,n){var t=(65535&r)+(65535&n);return(r>>16)+(n>>16)+(t>>16)<<16|65535&t}function e(r,n,e,o,a,u){return t((f=t(t(n,r),t(o,u)))<<(c=a)|f>>>32-c,e);var f,c}function o(r,n,t,o,a,u,f){return e(n&t|~n&o,r,n,a,u,f)}function a(r,n,t,o,a,u,f){return e(n&o|t&~o,r,n,a,u,f)}function u(r,n,t,o,a,u,f){return e(n^t^o,r,n,a,u,f)}function f(r,n,t,o,a,u,f){return e(t^(n|~o),r,n,a,u,f)}return function(n,t,e){var o=function(n,o,a,u){var f=a&&u||0;if("string"==typeof n&&(n=function(r){r=unescape(encodeURIComponent(r));for(var n=new Array(r.length),t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n}(n)),"string"==typeof o&&(o=function(r){var n=[];return r.replace(/[a-fA-F0-9]{2}/g,(function(r){n.push(parseInt(r,16))})),n}(o)),!Array.isArray(n))throw TypeError("value must be an array of bytes");if(!Array.isArray(o)||16!==o.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var c=e(o.concat(n));if(c[6]=15&c[6]|t,c[8]=63&c[8]|128,a)for(var i=0;i<16;++i)a[f+i]=c[i];return a||function(n,t){var e=t||0,o=r;return[o[n[e++]],o[n[e++]],o[n[e++]],o[n[e++]],"-",o[n[e++]],o[n[e++]],"-",o[n[e++]],o[n[e++]],"-",o[n[e++]],o[n[e++]],"-",o[n[e++]],o[n[e++]],o[n[e++]],o[n[e++]],o[n[e++]],o[n[e++]]].join("")}(c)};try{o.name=n}catch(r){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v3",48,(function(r){if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=new Array(n.length);for(var e=0;e<n.length;e++)r[e]=n.charCodeAt(e)}return function(r){var n,t,e,o=[],a=32*r.length;for(n=0;n<a;n+=8)t=r[n>>5]>>>n%32&255,e=parseInt("0123456789abcdef".charAt(t>>>4&15)+"0123456789abcdef".charAt(15&t),16),o.push(e);return o}(function(r,n){var e,c,i,d,s;r[n>>5]|=128<<n%32,r[14+(n+64>>>9<<4)]=n;var v=1732584193,h=-271733879,p=-1732584194,y=271733878;for(e=0;e<r.length;e+=16)c=v,i=h,d=p,s=y,v=o(v,h,p,y,r[e],7,-680876936),y=o(y,v,h,p,r[e+1],12,-389564586),p=o(p,y,v,h,r[e+2],17,606105819),h=o(h,p,y,v,r[e+3],22,-1044525330),v=o(v,h,p,y,r[e+4],7,-176418897),y=o(y,v,h,p,r[e+5],12,1200080426),p=o(p,y,v,h,r[e+6],17,-1473231341),h=o(h,p,y,v,r[e+7],22,-45705983),v=o(v,h,p,y,r[e+8],7,1770035416),y=o(y,v,h,p,r[e+9],12,-1958414417),p=o(p,y,v,h,r[e+10],17,-42063),h=o(h,p,y,v,r[e+11],22,-1990404162),v=o(v,h,p,y,r[e+12],7,1804603682),y=o(y,v,h,p,r[e+13],12,-40341101),p=o(p,y,v,h,r[e+14],17,-1502002290),h=o(h,p,y,v,r[e+15],22,1236535329),v=a(v,h,p,y,r[e+1],5,-165796510),y=a(y,v,h,p,r[e+6],9,-1069501632),p=a(p,y,v,h,r[e+11],14,643717713),h=a(h,p,y,v,r[e],20,-373897302),v=a(v,h,p,y,r[e+5],5,-701558691),y=a(y,v,h,p,r[e+10],9,38016083),p=a(p,y,v,h,r[e+15],14,-660478335),h=a(h,p,y,v,r[e+4],20,-405537848),v=a(v,h,p,y,r[e+9],5,568446438),y=a(y,v,h,p,r[e+14],9,-1019803690),p=a(p,y,v,h,r[e+3],14,-187363961),h=a(h,p,y,v,r[e+8],20,1163531501),v=a(v,h,p,y,r[e+13],5,-1444681467),y=a(y,v,h,p,r[e+2],9,-51403784),p=a(p,y,v,h,r[e+7],14,1735328473),h=a(h,p,y,v,r[e+12],20,-1926607734),v=u(v,h,p,y,r[e+5],4,-378558),y=u(y,v,h,p,r[e+8],11,-2022574463),p=u(p,y,v,h,r[e+11],16,1839030562),h=u(h,p,y,v,r[e+14],23,-35309556),v=u(v,h,p,y,r[e+1],4,-1530992060),y=u(y,v,h,p,r[e+4],11,1272893353),p=u(p,y,v,h,r[e+7],16,-155497632),h=u(h,p,y,v,r[e+10],23,-1094730640),v=u(v,h,p,y,r[e+13],4,681279174),y=u(y,v,h,p,r[e],11,-358537222),p=u(p,y,v,h,r[e+3],16,-722521979),h=u(h,p,y,v,r[e+6],23,76029189),v=u(v,h,p,y,r[e+9],4,-640364487),y=u(y,v,h,p,r[e+12],11,-421815835),p=u(p,y,v,h,r[e+15],16,530742520),h=u(h,p,y,v,r[e+2],23,-995338651),v=f(v,h,p,y,r[e],6,-198630844),y=f(y,v,h,p,r[e+7],10,1126891415),p=f(p,y,v,h,r[e+14],15,-1416354905),h=f(h,p,y,v,r[e+5],21,-57434055),v=f(v,h,p,y,r[e+12],6,1700485571),y=f(y,v,h,p,r[e+3],10,-1894986606),p=f(p,y,v,h,r[e+10],15,-1051523),h=f(h,p,y,v,r[e+1],21,-2054922799),v=f(v,h,p,y,r[e+8],6,1873313359),y=f(y,v,h,p,r[e+15],10,-30611744),p=f(p,y,v,h,r[e+6],15,-1560198380),h=f(h,p,y,v,r[e+13],21,1309151649),v=f(v,h,p,y,r[e+4],6,-145523070),y=f(y,v,h,p,r[e+11],10,-1120210379),p=f(p,y,v,h,r[e+2],15,718787259),h=f(h,p,y,v,r[e+9],21,-343485551),v=t(v,c),h=t(h,i),p=t(p,d),y=t(y,s);return[v,h,p,y]}(function(r){var n,t=[];for(t[(r.length>>2)-1]=void 0,n=0;n<t.length;n+=1)t[n]=0;var e=8*r.length;for(n=0;n<e;n+=8)t[n>>5]|=(255&r[n/8])<<n%32;return t}(r),8*r.length))}))}));